<!--Gordana Pejic 191/01-->
<?php
    require '../../pages/db.php';
    $con=dbConnect("sib");

    $hid=$_GET["hid"];

    $name=$_POST["name"];
    $address=$_POST["address"];
    $latitute=$_POST["lat"];
    $longitude=$_POST["long"];
    $pricemin=$_POST["pricemin"];
    $pricemax=$_POST["pricemax"];
    $rooms=$_POST["rooms"];
    $beds=$_POST["beds"];
    $toilets=$_POST["toilets"];
    $included=$_POST["included"];
    $reception=$_POST["reception"];
    $web=$_POST["web"];
    $fooddrink=$_POST["food"];
    $inroom=$_POST["inroom"];
    $todo=$_POST["todo"];
    $general=$_POST["general"];
    $desc=$_POST["desc"];
    $email=$_POST["email"];

    $sql="UPDATE hostel
          SET Name='$name', Address='$address', Latitude='$latitute', Longitude='$longitude', PriceMin='$pricemin',
          PriceMax='$pricemax', NumOfRooms='$rooms', NumOfBeds='$beds', NumOfToilets='$toilets', IncludedInPrice='$included',
          Reception='$reception', WebAccess='$web', FoodDrink='$fooddrink', InRoom='$inroom', ThingsToDo='$todo',
          General='$general', Description='$desc', Email='$email' 
          WHERE IDHostel='$hid'";

    $result = mysql_query($sql, $con);
   
    if (!$result)
        die('Error: ' . mysql_error());
    else
        header('Location: ../hostels-admin.php');
    
   // else echo'error in updating database!';


    mysql_close($con);

?>
